<%--
  Created by IntelliJ IDEA.
  User: 苏海娜
  Date: 2025/7/1
  Time: 20:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>用户登录 - 留言板</title>
    <!-- Bootstrap 5 CDN -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background: #f5f8fa;
        }
        .login-container {
            max-width: 400px;
            margin: 60px auto;
            background: #fff;
            padding: 32px 26px 24px 26px;
            border-radius: 8px;
            box-shadow: 0 2px 16px rgba(0,0,0,0.08);
        }
        .form-title {
            text-align: center;
            margin-bottom: 28px;
        }
    </style>
</head>
<body>
<div class="login-container shadow">
    <h3 class="form-title"><i class="fa fa-sign-in-alt"></i> 用户登录</h3>

    <c:if test="${not empty requestScope.error}">
        <div class="form-error">${requestScope.error}</div>
    </c:if>

<%--    <form action="LoginServlet" method="post">--%>
    <form action="login" method="post">

        <div class="mb-3">
            <label class="form-label" for="username"><i class="fa fa-user"></i> 用户名</label>
            <input type="text" class="form-control" id="username" name="username" required maxlength="30" placeholder="请输入用户名">
        </div>
        <div class="mb-3">
            <label class="form-label" for="password"><i class="fa fa-lock"></i> 密码</label>
            <input type="password" class="form-control" id="password" name="password" required minlength="6" placeholder="请输入密码">
        </div>
        <%-- 显示登录失败提示 --%>
<%--        <c:if test="${not empty errorMsg}">--%>
<%--            <div class="alert alert-danger py-2">${errorMsg}</div>--%>
<%--        </c:if>--%>
        <button type="submit" class="btn btn-primary w-100 mt-2"><i class="fa fa-sign-in-alt"></i> 登录</button>
        <div class="text-center mt-3">
            没有账号？<a href="register.jsp">立即注册</a>
        </div>
        <div class="text-center mt-3">
            <a href="admin_login.jsp">管理员账号登录</a>
        </div>
    </form>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
